package com.tec.cloud.notice.service;

import com.tec.cloud.notice.vo.ConfigVO;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CacheService {

    private final RedisTemplate<String, ConfigVO> redisTemplate;

    public CacheService(RedisTemplate redisTemplate) {
        this.redisTemplate = redisTemplate;
    }

    public List<ConfigVO> list(String redisKey) {
        return redisTemplate.opsForList().range(redisKey, 0, -1);
    }
}
